import request from '@/utils/request.js';

// 父栏目列表查询
export const pColumnListService = () => {
    return request.get('/columns/getParentColumns');
  };

// 获取父级子栏目
export const columnsService = (pid) => {
  return request.get(`/columns/getChildrenColumns?pid=${pid}`);
};
// 获取所有子栏目
export const AllChildrencolumnsService = () => {
  return request.get('/columns/selectAllChildrenColumns');
};


//文章列表查询
export const articleListService = (params) => {
  return request.get('/articles/list', { params: params })
}

//文章添加
export const articleAddService = (data) => {
  return request.post('/articles/add', data)
}

// 获取文章详情
export const articleDetailService = (articleId) => {
  return request.get(`/articles/getArticleById?articleId=${articleId}`);
};

// 更新文章
export const articleUpdateService = (article) => {
  return request.put('/articles/updateArticle', article);
};

// 删除文章服务
export const deleteArticleService = (articleId) => {
  return request.delete(`/articles/deleteArticle?articleId=${articleId}`);
};
